<?php
/**********************************************************
  eCode Marketing System
  Version 0.1
  Add Campaign (/admin/campaign_add.php)
**********************************************************/

// Require configuration
define("FROMSCRIPT", true);
require dirname(__FILE__) . "/../config.php";

// Start session if not already started
session_start();

if(!isset($_SESSION['login_t'])) {

	/* If we're not logged in, take us to the login page and
	ensure the rest of the code isn't run */

	header("Location: /admin/login.php");
	exit;
}

$pagetitle = "Add Campaign (Admin)";
$pageheading = "<a href=\"/admin/index.php\">" . SITE_NAME . " Administration</a> &gt; Add Campaign";
$page_content = "<hr />\n";

// Generate form
$page_content .= "<form action=\"/admin/handler.campaign_add.php\" method=\"post\">\n";
$page_content .= "<table class=\"table-60\">\n";
$page_content .= "<tr>";
$page_content .= "<td class=\"rightalign\"><label for=\"campaign_name\">Campaign Name:</label></td>";
$page_content .= "<td><input type=\"text\" name=\"campaign_name\" id=\"campaign_name\"></input></td>";
$page_content .= "</tr>\n";
$page_content .= "<tr>";
$page_content .= "<td class=\"rightalign\"><label for=\"start_day\">Campaign Start Date:<br />(MM/DD/CCYY)</label></td>";
$page_content .= "<td><input type=\"text\" name=\"start_month\" id=\"start_month\" maxlength=\"2\" size=\"2\"></input> / ";
$page_content .= "<input type=\"text\" name=\"start_day\" id=\"start_day\" maxlength=\"2\" size=\"2\"></input> / ";
$page_content .= "<input type=\"text\" name=\"start_year\" id=\"start_year\" maxlength=\"4\" size=\"4\"></input>";
$page_content .= "</td>";
$page_content .= "<tr>";
$page_content .= "<td class=\"rightalign\"><label for=\"end_day\">Campaign End Date:<br />(MM/DD/CCYY)</label></td>";
$page_content .= "<td><input type=\"text\" name=\"end_month\" id=\"end_month\" maxlength=\"2\" size=\"2\"></input> / ";
$page_content .= "<input type=\"text\" name=\"end_day\" id=\"end_day\" maxlength=\"2\" size=\"2\"></input> / ";
$page_content .= "<input type=\"text\" name=\"end_year\" id=\"end_year\" maxlength=\"4\" size=\"4\"></input>";
$page_content .= "</td>";
$page_content .= "</tr>\n";
$page_content .= "<tr>";
$page_content .= "<td colspan=\"2\" class=\"centered\">";
$page_content .= "<input type=\"submit\" value=\"Add Campaign\"></input>";
$page_content .= "</td>";
$page_content .= "</tr>\n";
$page_content .= "</table>\n";
$page_content .= "</form>\n";

$page_content .= "<hr />\n";
$page_content .= "<p><a href=\"/admin/index.php\">Back</a> to " . SITE_NAME . " Administration</p>\n";

// Require template
require TEMPLATE_DIR . "/index.php";
?>